<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<script language="javascript">
    function show(){
 document.getElementById('frtypeid').value ="";
        document.getElementById('frtypename').value ="";
        document.getElementById('frtypeid').disabled= true;
        document.fr.style.visibility='visible';
         document.getElementById('frinsert').style.visibility='visible';
        document.getElementById('frupdate').style.visibility='hidden';
        document.getElementById('frdelete').style.visibility='hidden';
    }


    function showedit1(element){

        document.fr.style.visibility='visible';
        document.getElementById('frinsert').style.visibility='hidden';
        document.getElementById('frupdate').style.visibility='visible';
        document.getElementById('frdelete').style.visibility='hidden';
        document.getElementById('frtypeid').disabled= true;
        document.getElementById('frtypeid').value = document.getElementById('fr1typeid'+element).value;
        document.getElementById('frtypename').value = document.getElementById('fr1typename'+element).value;
         document.getElementById('frtypeidd').value = document.getElementById('fr1typeid'+element).value;

    }
     function showedit2(element){

       document.fr.style.visibility='visible';
        document.getElementById('frinsert').style.visibility='hidden';
        document.getElementById('frupdate').style.visibility='hidden';
        document.getElementById('frdelete').style.visibility='visible';
        document.getElementById('frtypeid').disabled= true;
        document.getElementById('frtypeid').value = document.getElementById('fr1typeid'+element).value;
        document.getElementById('frtypename').value = document.getElementById('fr1typename'+element).value;
        document.getElementById('frtypeidd').value = document.getElementById('fr1typeid'+element).value;
    }
    function hiden()
    {
        document.frmMain.txtFid1.disabled = true;
    }
</script>
<form name="fr1">
    <p align="right">
                <a href="AdminTour.do?action=listTour" >tour manager</a>&emsp;&emsp;&emsp;
                <a href="AdminTour.do?action=listTourServices" >Tour Service manager</a> &emsp;&emsp;&emsp;
                <a href="AdminTour.do?action=listTourType" >Tour Type manager</a> &emsp;&emsp;&emsp;
                <a href="AdminTour.do?action=listTourLocation" >Location manager</a>
            </p>
    <table cellspacing="0" cellpadding="0" border="0" width="100%"><!-- Table -->
        <tr bgcolor="#92949E">
            <td><input type="checkbox"></td>
            <td><font size="2">TypeId</font></td>
            <td><font size="2">TypeName</font></td>
            <td><font size="2">Action</font></td>
        </tr>
        <logic:present name="listTour">
            <logic:iterate name="listTour" id="tourtype">
                <tr bgcolor="#F0F0F0">
                    <td><input type ="checkbox"/></td>
                    <td><font size="1"><input type="text" size="4" style="background-color:#F0F0F0" value="<bean:write name="tourtype" property="tourTypeId"/>"
                                              name="fr1typeid<bean:write name="tourtype" property="tourTypeId"/>"
                                              id="fr1typeid<bean:write name="tourtype" property="tourTypeId"/>"></font></td>
                                              <td><font size="1"><input type="text" style="background-color:#F0F0F0" size="50" value="<bean:write name="tourtype" property="tourTypeName"/>"
                                                                       name="fr1typename<bean:write name="tourtype" property="tourTypeId"/>"
                                              id="fr1typename<bean:write name="tourtype" property="tourTypeId"/>" ></font></td>
                    <td>
                        <img title="Add" src="admin/img/action_add.png" onclick="show();" style="cursor:pointer">


                        <img title="Edit" src="admin/img/action_remove.png" onclick="showedit1('<bean:write name="tourtype" property="tourTypeId"/>');" style="cursor:pointer">



                        <img title="Delete" src="admin/img/action_delete.png" onclick="showedit2('<bean:write name="tourtype" property="tourTypeId"/>');" style="cursor:pointer">


                    </td>
                </tr>
            </logic:iterate>
        </logic:present>
         <tr bgcolor="#92949E">

                 <td colspan="4" bgcolor="#92949E"> <font color="#92949E">ffff</font></td>
            </tr>
    </table>
</form>

<form name="fr" style="visibility:hidden" action="AdminTour.do" method="get">
                <table class="tablemain" border="0">
                    <tr >
                        <th height="32" colspan="3" scope="col">Manager Tour </th>
                    </tr>
                    <tr>
                        <td width="253" height="32"><div align="right">TypeId : </div></td>
                        <td width="510">
                            <input type="text" name="frtypeid" id="frtypeid" />
                            <input type="hidden" name="frtypeidd" id="frtypeidd" />
                        </td>
                    </tr>
                    <tr>
                        <td height="39"><div align="right">TypeName : </div></td>
                        <td><input type="text" size="50" name="frtypename" id="frtypename"/></td>

                    </tr>
                    <tr>
                        <td height="39" colspan="2"><div align="center">

                                <input type="submit" name="action" value="insertTourtype" id="frinsert" />
                                 <input type="submit" name="action" value="updateTourType" id="frupdate" />
                                  <input type="submit" name="action" value="deleteTourType" id="frdelete" />
                            </div>
                        </td>
                    </tr>
                </table>

            </form>

